Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing General Polygons

QuickDraw 3D provides routines that you can use to create and manipulate general polygons. See "General Polygons" for the definition of a general polygon.

Q3GeneralPolygon_New

You can use the Q3GeneralPolygon_New function to create a new general polygon.

TQ3GeometryObject Q3GeneralPolygon_New (
                     const TQ3GeneralPolygonData *generalPolygonData);
generalPolygonData
A pointer to a TQ3GeneralPolygonData structure.

DESCRIPTION

The Q3GeneralPolygon_New function returns, as its function result, a new general polygon having the contours and attributes specified by the generalPolygonData parameter. If a new general polygon could not be created, Q3GeneralPolygon_New returns the value NULL .

Q3GeneralPolygon_Submit

You can use the Q3GeneralPolygon_Submit function to submit an immediate general polygon for drawing, picking, bounding, or writing.

TQ3Status Q3GeneralPolygon_Submit (
                     const TQ3GeneralPolygonData *generalPolygonData,
                     TQ3ViewObject view);
generalPolygonData
A pointer to a TQ3GeneralPolygonData structure.
view
A view.

DESCRIPTION

The Q3GeneralPolygon_Submit function submits for drawing, picking, bounding, or writing the immediate general polygon whose shape and attribute set are specified by the generalPolygonData parameter. The general polygon is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3GeneralPolygon_GetData

You can use the Q3GeneralPolygon_GetData function to get the data that defines a general polygon and its attributes.

TQ3Status Q3GeneralPolygon_GetData (
                     TQ3GeometryObject generalPolygon,
                     TQ3GeneralPolygonData *generalPolygonData);
generalPolygon
A general polygon.
generalPolygonData
On exit, a pointer to a TQ3GeneralPolygonData structure that contains information about the general polygon specified by the generalPolygon parameter.

DESCRIPTION

The Q3GeneralPolygon_GetData function returns, through the generalPolygonData parameter, information about the general polygon specified by the generalPolygon parameter. QuickDraw 3D allocates memory for the TQ3GeneralPolygonData structure internally; you must call Q3GeneralPolygon_EmptyData to dispose of that memory.

Q3GeneralPolygon_SetData

You can use the Q3GeneralPolygon_SetData function to set the data that defines a general polygon and its attributes.

TQ3Status Q3GeneralPolygon_SetData (
                     TQ3GeometryObject generalPolygon,
                     const TQ3GeneralPolygonData *generalPolygonData);
generalPolygon
A general polygon.
generalPolygonData
A pointer to a TQ3GeneralPolygonData structure.

DESCRIPTION

The Q3GeneralPolygon_SetData function sets the data associated with the general polygon specified by the generalPolygon parameter to the data specified by the generalPolygonData parameter.

Q3GeneralPolygon_EmptyData

You can use the Q3GeneralPolygon_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3GeneralPolygon_GetData .

TQ3Status Q3GeneralPolygon_EmptyData (
                     TQ3GeneralPolygonData *generalPolygonData);
generalPolygonData
A pointer to a TQ3GeneralPolygonData structure.

DESCRIPTION

The Q3GeneralPolygon_EmptyData function releases the memory occupied by the TQ3GeneralPolygonData structure pointed to by the generalPolygonData parameter; that memory was allocated by a previous call to Q3GeneralPolygon_GetData .

Q3GeneralPolygon_GetVertexPosition

You can use the Q3GeneralPolygon_GetVertexPosition function to get the position of a vertex of a general polygon.

TQ3Status Q3GeneralPolygon_GetVertexPosition (
                     TQ3GeometryObject generalPolygon,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     TQ3Point3D *position);
generalPolygon
A general polygon.
contourIndex
An index into the contours array of the specified general polygon. This index should be greater than or equal to 0 and less than the number of contours in the contours array.
pointIndex
An index into the vertices array of the specified contour. This index should be greater than or equal to 0 and less than the number of points in the vertices array.
position
On exit, the position of the specified vertex.

DESCRIPTION

The Q3GeneralPolygon_GetVertexPosition function returns, in the position parameter, the position of a vertex in the general polygon specified by the generalPolygon parameter. The vertex has the index specified by the pointIndex parameter in the vertices array of the contour specified by the contourIndex parameter.

Q3GeneralPolygon_SetVertexPosition

You can use the Q3GeneralPolygon_SetVertexPosition function to set the position of a vertex of a general polygon.

TQ3Status Q3GeneralPolygon_SetVertexPosition (
                     TQ3GeometryObject generalPolygon,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     const TQ3Point3D *position);
generalPolygon
A general polygon.
contourIndex
An index into the contours array of the specified general polygon.
pointIndex
An index into the vertices array of the specified contour.
position
The desired position of the specified vertex.

DESCRIPTION

The Q3GeneralPolygon_SetVertexPosition function sets the position of a vertex in the general polygon specified by the generalPolygon parameter. The vertex has the index specified by the pointIndex parameter in the vertices array of the contour specified by the contourIndex parameter to the position specified in the position parameter.

Q3GeneralPolygon_GetVertexAttributeSet

You can use the Q3GeneralPolygon_GetVertexAttributeSet function to get the attribute set of a vertex of a general polygon.

TQ3Status Q3GeneralPolygon_GetVertexAttributeSet (
                     TQ3GeometryObject generalPolygon,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     TQ3AttributeSet *attributeSet);
generalPolygon
A general polygon.
contourIndex
An index into the contours array of the specified general polygon.
pointIndex
An index into the vertices array of the specified contour.
attributeSet
On exit, a pointer to a vertex attribute set for the specified vertex.

DESCRIPTION

The Q3GeneralPolygon_GetVertexAttributeSet function returns, in the attributeSet parameter, the set of attributes for the vertex having the index specified by the pointIndex parameter in the vertices array of the contour specified by the contourIndex parameter of the general polygon specified by the generalPolygon parameter. The reference count of the set is incremented.

Q3GeneralPolygon_SetVertexAttributeSet

You can use the Q3GeneralPolygon_SetVertexAttributeSet function to set the attribute set of a vertex of a general polygon.

TQ3Status Q3GeneralPolygon_SetVertexAttributeSet (
                     TQ3GeometryObject generalPolygon,
                     unsigned long contourIndex,
                     unsigned long pointIndex,
                     TQ3AttributeSet attributeSet);
generalPolygon
A general polygon.
contourIndex
An index into the contours array of the specified general polygon.
pointIndex
An index into the vertices array of the specified contour.
attributeSet
The desired set of attributes for the specified vertex.

DESCRIPTION

The Q3GeneralPolygon_SetVertexAttributeSet function sets the attribute set of the vertex having the index specified by the pointIndex parameter in the vertices array of the contour specified by the contourIndex parameter in the general polygon specified by the generalPolygon parameter to the set specified in the attributeSet parameter.

Q3GeneralPolygon_GetShapeHint

You can use the Q3GeneralPolygon_GetShapeHint function to get the shape hint of a general polygon.

TQ3Status Q3GeneralPolygon_GetShapeHint (
                     TQ3GeometryObject generalPolygon,
                     TQ3GeneralPolygonShapeHint *shapeHint);
generalPolygon
A general polygon.
shapeHint
On exit, the shape hint of the specified general polygon.

DESCRIPTION

The Q3GeneralPolygon_GetShapeHint function returns, in the shapeHint parameter, the shape hint of the general polygon specified by the generalPolygon parameter. See "General Polygons" for a description of the available shape hints.

Q3GeneralPolygon_SetShapeHint

You can use the Q3GeneralPolygon_SetShapeHint function to set the shape hint of a general polygon.

TQ3Status Q3GeneralPolygon_SetShapeHint (
                     TQ3GeometryObject generalPolygon,
                     TQ3GeneralPolygonShapeHint shapeHint);
generalPolygon
A general polygon.
shapeHint
The desired shape hint of the specified general polygon.

DESCRIPTION

The Q3GeneralPolygon_SetShapeHint function sets the shape hint of the general polygon specified by the generalPolygon parameter to the hint specified in the shapeHint parameter. See "General Polygons" for a description of the available shape hints.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |